package org.jeecg.config.oss;

import lombok.Data;
import org.jeecg.common.util.oss.ZosBootUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * 天翼云云存储 配置
 */
@Data
@Configuration
@ConditionalOnProperty(prefix = "jeecg.zos", name = "endpoint")
public class ZosConfiguration {

    @Value("${jeecg.zos.endpoint}")
    private String endpoint;
    @Value("${jeecg.zos.accessKey}")
    private String accessKey;
    @Value("${jeecg.zos.secretKey}")
    private String secretKey;
    @Value("${jeecg.zos.bucketName}")
    private String bucketName;


    @PostConstruct
    public void initOssBootConfiguration() {
        ZosBootUtil.init(this);
    }
}